#include "recvbox.h"
#include "ui_recvbox.h"
RecvBox::RecvBox(QWidget *parent) :
    Box(parent),
    ui(new Ui::RecvBox)
{
    ui->setupUi(this);
    ui->label_recvmessagecontent->setTextInteractionFlags(Qt::TextSelectableByMouse);
    ui->label_recvmessagecontent->setWordWrap(true);
    ui->label_recvmessageavatar->setScaledContents(true);
}



RecvBox::~RecvBox()
{
    delete ui;
}


void RecvBox::setAvatar(const QPixmap avatar)
{

    //QRegion region(ui->label_recvmessageavatar->rect(), QRegion::Ellipse);
    //ui->label_recvmessageavatar->setMask(region);
    ui->label_recvmessageavatar->setPixmap(avatar);
}

void RecvBox::setText(const QString text)
{
    ui->label_recvmessagecontent->setText(text);
}


QSize RecvBox::getSize(){
    return this->sizeHint();
}


